﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using D6.DFS.Consumer;

namespace SessionCountingApp
{
    public class DfsWrapper : DfsConsumer
    {
        int countOfDfcSessions = 0;

        public DfsWrapper(String repository, String username, String password)
            : base(repository, username, password)
        {

        }

        protected override void processQueryResults(D6.DFS.Consumer.QueryService.QueryResult repositoryItems)
        {
            countOfDfcSessions = repositoryItems.dataPackage.DataObjects.Count();

        }

        public int getOpenSessions()
        {
            Results_To_Return = 50;
            executeDQL("execute show_sessions");
            return countOfDfcSessions;

        }

    }
}
